package com.xzx.mapper;

import com.xzx.po.PermissionPO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 *
 * @author xinzhixuan
 * @version 1.0
 * @date 2025/8/18 14:08
 */
@Mapper
public interface PermissionMapper {

    List<PermissionPO> selectAll();

    void insert(PermissionPO permissionPO);

    void delete(@Param("id") Long id);

    PermissionPO getById(@Param("id") Long id);

    void update(PermissionPO permissionPO);

    void doAssign(@Param("roleId") Long roleId,
                  @Param("permissionIds") List<Long> permissionIds);

    void deleteByRoleId(@Param("roleId") Long roleId);

    List<PermissionPO> selectByRoleId(@Param("roleId") Long roleId);

    void deleteByRoleIds(@Param("roleIds") List<Long> roleIds);

    List<PermissionPO> selectPermission(@Param("roleIds") List<Long> roleIds);

    List<PermissionPO> selectPermissionByUserId(@Param("userId") Long userId);
}
